Variables defined by declare and @set are often seen in stored procedures. In simple terms, the declare definition is similar to a local variable, @set a similar global variable defined.
1. Declare-defined variables are similar to local variables
The declare and typeset commands are the built-in commands for Bash, both of which are exactly the same, used to declare shell variables and to set the properties of the variables.The Declare command (alias typeset) is a shell built-in command for
You may not know, define, declare, initialize, declare Initialization
Declaration definitions are everywhere, but they are not as simple as they are.First, from a broad perspective, a declaration contains a definition, which can also be referred to
Linux bash Shell's declare declare or typeset built-in commands (which are exactly the same) can be used to constrain the properties of a variable. This is a way to use a less restrictive definition type in some programming languages. Command
compiler compiles a program, it compiles only one source file and generates the corresponding intermediate file (for the VC, the. obj file), and then the connector unifies all intermediate files to form an executable file. The problem is that when
The Declaration tells the compiler some information to assist the compiler in syntax analysis and avoid compiler errors. The definition is to tell the compiler to generate some code that will be used by the connector. That is, the Declaration is for
Experimental environmentCommand descriptionThe declare and typeset commands are bash's built-in commands (BUILTIN commands), both of which function exactly the same way to set variable values and properties.Typeset is now deprecated and replaced by
C + + Enumeration typeIf a variable has only a few possible values, it can be defined as an enumeration (enumeration) type. The so-called "enumeration" refers to the value of the variable enumerated, the value of the variable can only be listed in
1. PS1: (set the prompt character)
This is interesting. You can customize your own prompt;
Every time we press the [enter] key to execute a command, the prompt character will appear again, and we will take the initiative to read the variable
How to use Declare-styleable
In the create XML to objectname/res/values/named Attrs.xml
Edit file contents as (example)
in the definition file in the Layout folder, refer to at Use & nbsp xmlns:app=
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.